<div>
	<!-- widget content -->
	<div class="widget-body">

		<form action="" method="post" id="checkout-form" class="smart-form">
			<header>
				<h2>
					主机详情
					<button class="close" data-dismiss="modal">x</button>
				</h2>

			</header>
			<fieldset>
				<div id="dialog-alert"></div>
				<div class="row">
					<label class="label col col-2"><label style="color: red">*</label>主机ID</label>
					<section class="col col-4">
						<label class="input"> <input type="text" id="id" name="id"
							disabled="disabled">
						</label>
					</section>
					<label class="label col col-2"><label style="color: red">*</label>主机名称</label>
					<section class="col col-4">
						<label class="input"> <label class="input"> <input
								type="text" id="name" name="name" disabled="disabled">
						</label>
						</label>
					</section>
				</div>
				<div class="row">
					<label class="label col col-2"><label style="color: red">*</label>IP地址</label>
					<section class="col col-4">
						<label class="input"> <input type="text" id="sshIp"
							name="sshIp" disabled="disabled">
						</label>
					</section>
					<label class="label col col-2"><label style="color: red">*</label>所在站点</label>
					<section class="col col-4">
						<label class="input"> <label class="input"> <input
								type="text" id="siteName" name="siteName" disabled="disabled">
						</label>
						</label>
					</section>
				</div>
				<div class="row">
					<label class="label col col-2"><label style="color: red">*</label>所属区域</label>
					<section class="col col-4">
						<label class="input"> <input type="text" id="areaName"
							name="areaName" disabled="disabled">
						</label>
					</section>
					<label class="label col col-2"><label style="color: red">*</label>所属集群</label>
					<section class="col col-4">
						<label class="input"> <label class="input"> <input
								type="text" id="clusterName" name="clusterName"
								disabled="disabled">
						</label>
						</label>
					</section>
				</div>
				<div class="row">
					<label class="label col col-2"><label style="color: red">*</label>库房</label>
					<section class="col col-4">
						<label class="input"> <input type="text" id="room"
							name="room" disabled="disabled">
						</label>
					</section>
					<label class="label col col-2"><label style="color: red">*</label>机架</label>
					<section class="col col-4">
						<label class="input"> <label class="input"> <input
								type="text" id="name02" name="name02" disabled="disabled">
						</label>
						</label>
					</section>
				</div>
				<div class="row">
					<label class="label col col-2"><label style="color: red">*</label>运行状态</label>
					<section class="col col-4">
						<label class="input"> <input type="text" id="statusText"
							name="statusText" disabled="disabled">
						</label>
					</section>
					<label class="label col col-2"><label style="color: red">*</label>实例上限</label>
					<section class="col col-4">
						<label class="input"> <label class="input"> <input
								type="text" id="maxContainer" name="maxContainer"
								disabled="disabled">
						</label>
						</label>
					</section>
				</div>
				<div class="row">
					<label class="label col col-2"><label style="color: red">*</label>入库时间</label>
					<section class="col col-8">
						<label class="input"> <input type="text"
							id="createDateTime" name="createDateTime" disabled="disabled">
						</label>
					</section>
				</div>
				<div class="row">
					<label class="label col col-2"><label style="color: red">*</label>CPU总数</label>
					<section class="col col-4">
						<label class="input"> <input type="text" id="cpuCnt"
							name="cpuCnt" disabled="disabled">
						</label>
					</section>
					<label class="label col col-2"><label style="color: red">*</label>CPU已分配</label>
					<section class="col col-4">
						<label class="input"> <label class="input"> <input
								type="text" id="usedCpuCnt" name="usedCpuCnt"
								disabled="disabled">
						</label>
						</label>
					</section>
				</div>
				<div class="row">
					<label class="label col col-2"><label style="color: red">*</label>内存容量</label>
					<section class="col col-4">
						<label class="input"> <input type="text" id="memCnt"
							name="memCnt" disabled="disabled">
						</label>
					</section>
					<label class="label col col-2"><label style="color: red">*</label>内存已分配</label>
					<section class="col col-4">
						<label class="input"> <label class="input"> <input
								type="text" id="usedMemCnt" name="usedMemCnt"
								disabled="disabled">
						</label>
						</label>
					</section>
				</div>
				<div class="row">
					<label class="label col col-2"><label style="color: red">*</label>HDD总量</label>
					<section class="col col-4">
						<label class="input"> <input type="text" id="hddCnt"
							name="hddCnt" disabled="disabled">
						</label>
					</section>
					<label class="label col col-2"><label style="color: red">*</label>HDD已分配</label>
					<section class="col col-4">
						<label class="input"> <label class="input"> <input
								type="text" id="usedHddCnt" name="usedHddCnt"
								disabled="disabled">
						</label>
						</label>
					</section>
				</div>
				<div class="row">
					<label class="label col col-2"><label style="color: red">*</label>SSD总量</label>
					<section class="col col-4">
						<label class="input"> <input type="text" id="ssdCnt"
							name="ssdCnt" disabled="disabled">
						</label>
					</section>
					<label class="label col col-2"><label style="color: red">*</label>SSD已分配</label>
					<section class="col col-4">
						<label class="input"> <label class="input"> <input
								type="text" id="usedSsdCnt" name="usedSsdCnt"
								disabled="disabled">
						</label>
						</label>
					</section>
				</div>
			</fieldset>
		</form>


	</div>
	<!-- end widget content -->

</div>
<div class="modal-footer">

	<button type="button" class="btn btn-default btn-sm"
		data-dismiss="modal">取消</button>
	<button type="submit" class="btn btn-primary btn-sm" id="submitbtn">
		保存</button>
</div>
<script>
    pageSetUp();
    var pagefunction = function() {
    	$('#site').val(getSession("siteId"));
        var s = $("#jqgrid").jqGrid('getGridParam', 'selarrrow');
        var hostid = $("#jqgrid").jqGrid('getRowData',s).id;
        sendGet("/upm_manager/v1.0/hosts/"+hostid,fillForm,DialogAlert,null); 
    };
    
    loadScript("js/plugin/jquery-form/jquery-form.min.js", pagefunction);
    
    function fillForm(data){
    	var hostsdata=data['data'];
        $('#id').val(hostsdata.id);
        $('#name').val(hostsdata.name);
        $('#sshIp').val(hostsdata.sshIp);
        $('#siteName').val(hostsdata.siteName);
        $('#areaName').val(hostsdata.areaName);
        $('#clusterName').val(hostsdata.clusterName);
        $('#room').val(hostsdata.room);
        $('#name02').val(hostsdata.name);
        $('#statusText').val(hostsdata.statusText);
        $('#maxContainer').val(hostsdata.maxContainer);
        $('#createDateTime').val(hostsdata.createDateTime);
        $('#cpuCnt').val(hostsdata.cpuCnt);
        $('#usedCpuCnt').val(hostsdata.usedCpuCnt);
        $('#memCnt').val(((hostsdata.memCnt)/1024/1024/1024).toFixed(1)+"G");
        $('#usedMemCnt').val(((hostsdata.usedMemCnt)/1024/1024/1024).toFixed(1)+"G");
        $('#hddCnt').val(((hostsdata.hddCnt)/1024/1024/1024).toFixed(1)+"G");
        $('#usedHddCnt').val(((hostsdata.usedHddCnt)/1024/1024/1024).toFixed(1)+"G");
        $('#ssdCnt').val(((hostsdata.ssdCnt)/1024/1024/1024).toFixed(1)+"G");
        $('#usedSsdCnt').val(((hostsdata.usedSsdCnt)/1024/1024/1024).toFixed(1)+"G");
    }
</script>